#include <iostream>
#include <assert.h>
using namespace std;
namespace cx
{
	class string
	{
	public:
		char& operator[](size_t pos)
		{
			assert(pos < _size);
			return _str[pos];
		}
		const char& operator[](size_t pos)const
		{
			assert(pos < _size);
				return _str[pos];
		}
	private:
		char* _str;
		size_t _size;
		size_t _capacite;
	};
}
int main()
{
	string s1("hello world");
	/*for (int i = 0; i < s1.size(); i++)
	{
		cout << s1[i] << endl;
	}*/
	/*string::iterator it = s1.begin();
	while (it < s1.end())
	{
		cout << *it << endl;
		it++;
	}*/
	/*string::reverse_iterator rit = s1.rbegin();
	while (rit != s1.rend())
	{
		cout << *rit << "";
		++rit;
	}
	cout << endl;*/
	for (auto i : s1)
	{
		cout << i << "";
	}
	cout << endl;
	return 0;
}